global soal1 soal2
global numsoal
global x0 xn h n y01 y02 numy0
global fungsi1 fungsi2
global numfungsi
global metodestring
global hasil1 hasil2 
global numhasil

x = [0 10];
h = 0.5;
y0 = [4 6];
y_absen = @(x,y,z)(-0.5*y); 
z_absen = @(x,y,z)(4-0.3*z-0.1*y);
orde = [ 3 4 ];

% Orde 3
[n result1] = Runge_Kutta(x,h,y0,y_absen,orde(1));
[n result2] = Runge_Kutta(x,h,y0,z_absen,orde(1));

% Orde 4
[n result3] = Runge_Kutta(x,h,y0,y_absen,orde(2));
[n result4] = Runge_Kutta(x,h,y0,z_absen,orde(2));

result = [result1(1) result2(2) result3(1) result4(2)];

clear result1 result2 result3 result4;

%------------------------------------------------%
% Pembuatan report
%------------------------------------------------%
% Soal
soal1 = 'y'' = -0.5*y';
soal2 = 'z'' = 4 - 0.3*z - 0.1*y';
numsoal = 2;
% Variabel
x0 = x(1); xn = x(2);
% h = h (variabel dan globalnya sama)
% n = n (variabel dan globalnya sama)
y01 = y0(1); y02 = y0(2);
numy0 = 2;
% Fungsi untuk perhitungan
fungsi1 = func2str(y_absen);
fungsi2 = func2str(z_absen);
numfungsi = 2;
% Metode
metodestring = 'Runge-Kutta Orde 3';
% Hasil
hasil1 = result(1);
hasil2 = result(2);
numhasil = 2;
% Generate Report
report('DifferentialEquation');
